﻿using System;
using System.Threading;
using Mono.Collections.Generic;

namespace Mono.Cecil
{
	// Token: 0x020000A1 RID: 161
	public sealed class MethodReturnType : IConstantProvider, IMetadataTokenProvider, ICustomAttributeProvider, IMarshalInfoProvider
	{
		// Token: 0x17000177 RID: 375
		// (get) Token: 0x06000657 RID: 1623 RVA: 0x00021130 File Offset: 0x0001F330
		public IMethodSignature Method
		{
			get
			{
				return this.method;
			}
		}

		// Token: 0x17000178 RID: 376
		// (get) Token: 0x06000658 RID: 1624 RVA: 0x00021148 File Offset: 0x0001F348
		// (set) Token: 0x06000659 RID: 1625 RVA: 0x00004581 File Offset: 0x00002781
		public TypeReference ReturnType
		{
			get
			{
				return this.return_type;
			}
			set
			{
				this.return_type = value;
			}
		}

		// Token: 0x17000179 RID: 377
		// (get) Token: 0x0600065A RID: 1626 RVA: 0x00021160 File Offset: 0x0001F360
		internal ParameterDefinition Parameter
		{
			get
			{
				bool flag = this.parameter == null;
				if (flag)
				{
					Interlocked.CompareExchange<ParameterDefinition>(ref this.parameter, new ParameterDefinition(this.return_type, this.method), null);
				}
				return this.parameter;
			}
		}

		// Token: 0x1700017A RID: 378
		// (get) Token: 0x0600065B RID: 1627 RVA: 0x000211A4 File Offset: 0x0001F3A4
		// (set) Token: 0x0600065C RID: 1628 RVA: 0x0000458B File Offset: 0x0000278B
		public MetadataToken MetadataToken
		{
			get
			{
				return this.Parameter.MetadataToken;
			}
			set
			{
				this.Parameter.MetadataToken = value;
			}
		}

		// Token: 0x1700017B RID: 379
		// (get) Token: 0x0600065D RID: 1629 RVA: 0x000211C4 File Offset: 0x0001F3C4
		// (set) Token: 0x0600065E RID: 1630 RVA: 0x0000459B File Offset: 0x0000279B
		public ParameterAttributes Attributes
		{
			get
			{
				return this.Parameter.Attributes;
			}
			set
			{
				this.Parameter.Attributes = value;
			}
		}

		// Token: 0x1700017C RID: 380
		// (get) Token: 0x0600065F RID: 1631 RVA: 0x000211E4 File Offset: 0x0001F3E4
		// (set) Token: 0x06000660 RID: 1632 RVA: 0x000045AB File Offset: 0x000027AB
		public string Name
		{
			get
			{
				return this.Parameter.Name;
			}
			set
			{
				this.Parameter.Name = value;
			}
		}

		// Token: 0x1700017D RID: 381
		// (get) Token: 0x06000661 RID: 1633 RVA: 0x00021204 File Offset: 0x0001F404
		public bool HasCustomAttributes
		{
			get
			{
				return this.parameter != null && this.parameter.HasCustomAttributes;
			}
		}

		// Token: 0x1700017E RID: 382
		// (get) Token: 0x06000662 RID: 1634 RVA: 0x0002122C File Offset: 0x0001F42C
		public Collection<CustomAttribute> CustomAttributes
		{
			get
			{
				return this.Parameter.CustomAttributes;
			}
		}

		// Token: 0x1700017F RID: 383
		// (get) Token: 0x06000663 RID: 1635 RVA: 0x0002124C File Offset: 0x0001F44C
		// (set) Token: 0x06000664 RID: 1636 RVA: 0x000045BB File Offset: 0x000027BB
		public bool HasDefault
		{
			get
			{
				return this.parameter != null && this.parameter.HasDefault;
			}
			set
			{
				this.Parameter.HasDefault = value;
			}
		}

		// Token: 0x17000180 RID: 384
		// (get) Token: 0x06000665 RID: 1637 RVA: 0x00021274 File Offset: 0x0001F474
		// (set) Token: 0x06000666 RID: 1638 RVA: 0x000045CB File Offset: 0x000027CB
		public bool HasConstant
		{
			get
			{
				return this.parameter != null && this.parameter.HasConstant;
			}
			set
			{
				this.Parameter.HasConstant = value;
			}
		}

		// Token: 0x17000181 RID: 385
		// (get) Token: 0x06000667 RID: 1639 RVA: 0x0002129C File Offset: 0x0001F49C
		// (set) Token: 0x06000668 RID: 1640 RVA: 0x000045DB File Offset: 0x000027DB
		public object Constant
		{
			get
			{
				return this.Parameter.Constant;
			}
			set
			{
				this.Parameter.Constant = value;
			}
		}

		// Token: 0x17000182 RID: 386
		// (get) Token: 0x06000669 RID: 1641 RVA: 0x000212BC File Offset: 0x0001F4BC
		// (set) Token: 0x0600066A RID: 1642 RVA: 0x000045EB File Offset: 0x000027EB
		public bool HasFieldMarshal
		{
			get
			{
				return this.parameter != null && this.parameter.HasFieldMarshal;
			}
			set
			{
				this.Parameter.HasFieldMarshal = value;
			}
		}

		// Token: 0x17000183 RID: 387
		// (get) Token: 0x0600066B RID: 1643 RVA: 0x000212E4 File Offset: 0x0001F4E4
		public bool HasMarshalInfo
		{
			get
			{
				return this.parameter != null && this.parameter.HasMarshalInfo;
			}
		}

		// Token: 0x17000184 RID: 388
		// (get) Token: 0x0600066C RID: 1644 RVA: 0x0002130C File Offset: 0x0001F50C
		// (set) Token: 0x0600066D RID: 1645 RVA: 0x000045FB File Offset: 0x000027FB
		public MarshalInfo MarshalInfo
		{
			get
			{
				return this.Parameter.MarshalInfo;
			}
			set
			{
				this.Parameter.MarshalInfo = value;
			}
		}

		// Token: 0x0600066E RID: 1646 RVA: 0x0000460B File Offset: 0x0000280B
		public MethodReturnType(IMethodSignature method)
		{
			this.method = method;
		}

		// Token: 0x040001CF RID: 463
		internal IMethodSignature method;

		// Token: 0x040001D0 RID: 464
		internal ParameterDefinition parameter;

		// Token: 0x040001D1 RID: 465
		private TypeReference return_type;
	}
}
